<template>
  <a-image
    :src="vc"
    :width="width"
    :height="height"
    :preview="false"
    @click="$emit('update')"
  />
</template>

<script setup lang="ts">
  import { computed } from 'vue';
  import vc from '../../assets/images/verifycode.png';

  const props = defineProps({
    timestamp: {
      type: Number,
      required: true,
    },
    width: {
      type: Number,
      default: 90,
    },
    height: {
      type: Number,
      default: 30,
    },
  });

  const url = computed(() => {
    // TODO change url
    return `${import.meta.env.VITE_CLIENT_API_BASE_URL}/client-api/common/verifyCode/login/${props.timestamp}/${props.width}/${props.height}`;
  });
</script>
